const users = require('../controllers/users.controller')
const auth = require('../lib/middleware.js')
module.exports = function (app) {
  app.route('/users')
    .post(auth.isAuthenticated,users.createUser)
    .get(auth.isAuthenticated,users.getAllUsers)
  app.route('/users/:id')
    .get(auth.isAuthenticated,users.getUserById)
  app.route('/login')
    .post(users.login)
  app.route('/logout')
    .post(users.logout)

}
